package cn.iocoder.mall.product.api;

import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.product.api.bo.*;
import cn.iocoder.mall.product.api.dto.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.Collection;
import java.util.List;

public interface ProductSpuService {

    ProductSpuDetailBO getProductSpuDetail(Long id);

    /**
     * 增量获得商品列表，按照 lastId 递增获得
     *
     * @param lastId 最后查询的编号
     * @param limit 大小
     * @return 商品列表
     */
    List<ProductSpuDetailBO> getProductSpuDetailListForSync(Long lastId, Integer limit);

    ProductSpuPageBO getProductSpuPage(ProductSpuPageDTO productSpuPageDTO);

    List<ProductSpuBO> getProductSpuSearchList(ProductSpuSearchListDTO productSpuSearchListDTO);

    List<ProductSpuBO> getProductSpuList(Collection<Long> ids);

    ProductSkuBO getProductSku(Long id);

    List<ProductSkuDetailBO> getProductSkuDetailList(Collection<Long> ids);

    ProductSpuDetailBO addProductSpu(String adminId, ProductSpuAddDTO productSpuAddDTO);

    void updateProductSpu(String adminId, ProductSpuUpdateDTO productSpuUpdateDTO);

    Boolean updateProductSpuSort(String adminId, Long spuId, Integer sort);

    Boolean decreaseProductSkuQuantity(Collection<ProductSkuDecreaseNumDTO> ids);

    CommonResult recoveryProductSkuQuantity(Collection<ProductSkuDecreaseNumDTO> ids);

    ProductSpuBO getProductSpu(Long spuId);

    List<SimpleSpuInfoBO> getProductSpuListBySkuIds(List<Long> ids);
}
